package spring.superrun.record.mvc;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import springfox.documentation.service.Contact;

/**
 * @program:swagger
 * @description:swagger配置类
 * @author haoboyuan
 * @create:2021/6/16
 */
@Configuration
@EnableSwagger2
public class Swagger2Config {
    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .pathMapping("/")
                .select()
                .apis(RequestHandlerSelectors.basePackage("spring.superrun.record.mvc"))
                .paths(PathSelectors.any())
                .build().apiInfo(new ApiInfoBuilder()
                        .title("打卡控制平台Api接口文档")
                        .description("诺嘉网络-NGIT")
                        .version("1.0")
                        .contact(new Contact("hby", "self.nuogit.com", "1944703558@qq.com"))
                        .license("The Apache License")
                        .licenseUrl("http://www.nuogit.com")
                        .build());
    }
}